package com.wutma.friend.controller.file;

import com.wutma.common.core.domain.R;
import com.wutma.common.domain.COSResult;
import com.wutma.friend.service.file.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RequestMapping("/file")
@RestController
public class FileController {

    @Autowired
    private FileService fileService;

    @PostMapping("/upload")
    public R<COSResult> upload(@RequestParam MultipartFile file) {
        return R.ok(fileService.upload(file));
    }
}
